package com.cn.xiaonuo.sys.modular.news.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 新闻实体类
 */
@Data
@TableName(value = "t_news")
public class News {


    @TableId(type = IdType.AUTO)
    private Long id;
    private String title;

    private String content;
    /**
     * 封面
     */
    private String firstPicture;
    private String flag;
    private Integer views;
    private boolean appreciation;
    private boolean share;
    private boolean comment;
    private boolean published;
    private boolean recommend;
    private String description;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    /**
     *类型id
     */
    private String type;
    /**
     * 发布者id
     */
    private Long userid;
    /**
     * 0 草稿 1 发布 2撤回 3删除
     */
    private Integer status;
    /**
     * 发布者名字
     */
    private String username;

    @TableField(exist = false)
    private List<Tag> tags = new ArrayList<>();

    @TableField(exist = false)
    private List<Comment> comments = new ArrayList<>();

    @TableField(exist = false)
    private List<Type> types=new ArrayList<>();

}
